// src/router/index.js
import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';
import RestaurantDetail from '../views/RestaurantDetail.vue';
import UserProfile from '../views/UserProfile.vue';

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/restaurant/:id',
    name: 'restaurant-detail',
    component: RestaurantDetail,
    props: true // 如果需要传递参数给组件
  },
  {
    path: '/user',
    name: 'user',
    component: UserProfile
  },
  {
    path: '/restaurant-list',
    name: 'restaurant-list',
    component: () => import('../views/RestaurantList.vue') // 假设你有一个餐厅列表页面
  }
];

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
});

export default router;